package com.akbar;
import org.mindrot.jbcrypt.BCrypt;

public class Main {
    public static void main(String[] args) {
        String password = "123";

        // 生成加密哈希
        String hashed = BCrypt.hashpw(password, BCrypt.gensalt());
        System.out.println(hashed);

        // 验证密码
        boolean match = BCrypt.checkpw(password, hashed);
        if (match) {
            System.out.println("密码正确");
        } else {
            System.out.println("密码不正确");
        }
    }
}